package org.gis.mapserver.manager;

import org.gis.mapserver.responsewriter.ResponseWriter;
import org.gis.mapserver.layer.Layer;
import org.gis.mapserver.rendercontext.RenderingContext;
import org.gis.mvc.bean.RequestBean;

/**
 *
 * @author gus
 */
public class SimpleProcessingManager extends AbstractProcessingManager
{
    public ResponseWriter processing( RequestBean requestBean ) throws Exception
    {
        if ( requestBean == null )
        {
            throw new IllegalArgumentException("requestBean");
        }
        RenderingContext context = renderingContextFactory.createRenderingContext(requestBean);
        for ( String layerName : requestBean.getLayerNames() )
        {
            Layer layer = layerFactory.creatLayer(layerName, true);
            layer.render(context);
        }
        return context.getResponseWriter();
    }
}
